//
//  UIImage.swift
//  maopu
//
//  Created by xiongsh on 2017/4/27.
//  Copyright © 2017年 maopu. All rights reserved.
//

import UIKit

extension UIImage {
    class func createImageWithColor(color: UIColor)->UIImage {
        let frame: CGRect = CGRect.init(x: 0, y: 0, width: 1.0, height: 1.0)
        
        UIGraphicsBeginImageContext(frame.size)
        let context = UIGraphicsGetCurrentContext()
        context?.setFillColor(color.cgColor)
        context?.fill(frame)
        let image: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
        UIGraphicsEndImageContext()
        return image
    }
}
